var $sWidth = $(window).width();
var $sHeight = $(window).height();
var $currPage = 1;
var $totalElements = 0;
var $pageSize = 6;
var $totalPages = 1;
var $showPagesNum = 10;
var $ajaxUrl = "";
//初始化弹出框位置
function initDialogPosition(id){
	var dWidth = $("#"+id).width();
	var dHeight = $("#"+id).height();
	$("#"+id).css("top",-dHeight-100);
	$("#"+id).css("left",($sWidth-dWidth)/2);
}
//显示弹出框
function showDialog(id,time,isReload){
	$("#"+id).css("display","block");
	var dWidth = $("#"+id).width();
	var dHeight = $("#"+id).height();
	$("#"+id+"_shadowDiv").css("display","block");
	$("#"+id).css("left",($sWidth-dWidth)/2);
	$("#"+id).animate(
		{"top":($sHeight-dHeight)/2-100},
		"slow",
		function() { 
			if(time!=undefined){
				setTimeout("hideDialog('"+id+"',"+isReload+")",time);
			}
		}
	);
	
}
//隐藏弹出框
function hideDialog(id,isReload,func){
	var dWidth = $("#"+id).width();
	var dHeight = $("#"+id).height();
	$("#"+id+" .dialogContentDiv input").val("");
	$("#"+id+"_shadowDiv").css("display","none");
	$("#"+id).css("left",($sWidth-dWidth)/2);
	$("#"+id).animate(
		{
			"top":-dHeight-100},
			"slow",
			function(){
				$("#"+id).css("top",-dHeight-100);
				if(isReload!=undefined&&isReload){
					window.location.reload();
				}
				if(func){
					func();
				}
			}
		);
}


